package com.elantra.controller;

import com.elantra.entity.ElantraMenu;
import com.elantra.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("menu")
public class MenuController {
    @Autowired
    private MenuService menuService;

    @RequestMapping(value = "/getMenuList",method = RequestMethod.POST)
    @ResponseBody
    public List<ElantraMenu> getMenuList() {
        return menuService.getAll();
    }
}
